<?php if(isset($message) AND isset($grade))
{
    echo '<div class="alert alert-'.$grade.'">'.$message.'</div>';
}
?>